<!-- BEGIN: PAGECONTENT -->
        <script type="text/javascript">
			$(document).ready(function() {
			    //validate signup form on keyup and submit
			    $("#admin_form").validate({
			        rules: {
			        	ImageLink: {
			                required: true,
			                maxlength: 10000
			            }
			        },
			        messages: {
			        	ImageLink: {
			            	required: "Vui lòng chọn ảnh hiển thị",
			                maxlength: "This field can not have max lenght than 10000 character"
			            }
			        }
			    });
			    
			    // Initialise FancyBox Modal window:
			    $("a.fancy").fancybox({
			        'titlePosition' : 'inside'
			    });
			});
		</script>
		<style type="text/css">
		    #admin_form label.error { width: 100%; color:red; margin-top:5px;}
		</style>
        <script type="text/javascript">
            function BrowseServer()
            {
                var finder = new CKFinder();
                finder.basePath = 'images/';
                finder.selectActionFunction = SetFileField;
                finder.popup();
            }
            // This is a sample function which is called when a file is selected in CKFinder.
            function SetFileField( fileUrl )
            {
            	$("#ImageLink").val(fileUrl);
                $("a.fancy").attr("href", fileUrl);
                $("#upload-img").attr("src",fileUrl);
            }
        </script>
        <div class="form-content-page">
            <section>
			        <form class="block-content form" id="admin_form" method="post" action="submit.php?ctrl={CONTROLLER}&act={ACTION}">
			            <h2>{FORMTITLE}</h2>
			            <!-- BEGIN: FORMITEM -->
			            <fieldset>
			                <legend>
			                    Thông tin ảnh hiển thị
			                </legend>
			                <input type="hidden" name="ID" id="ID" value="{FORMITEM.ID}">
			                <input type="hidden" name="Type" id="Type" value="{FORMITEM.Type}">
			                <div class="columns">
                                <div class="colx2-left">
                                	
                                </div>
                                <div class="colx2-right">
                                    
                                </div>
                            </div>
                            
			                <div class="columns">
                                <div class="colx2-left">
                                	<div class="imageBox">
		                                <label for="simple-calendar">Đường dẫn ảnh</label>
		                                    <div style="width: 100%" align="center">
		                                   		<a href="{FORMITEM.ImageLink}" class="fancy" rel="group" id="upload-img-fancy"><img src="{FORMITEM.ImageLink}" id="upload-img" style="max-height: 250px; max-width: 100%"></a>
		                                	</div>
		                                	<br />
		                                    <input type="text" name="ImageLink" id="ImageLink" value="{FORMITEM.ImageLink}" class="half-width" readonly="readonly">
		                                    &nbsp;&nbsp;<button type="button" class="grey browser-file" onclick="BrowseServer();">Chọn ảnh</button>
		                                
		                                
		                            </div>
                                </div>
                                <div class="colx2-right">
                                    <p>
					                    <label for="simple-required">Thuôc tính title của thẻ img</label>
					                    <input type="text" name="ImageTitle" id="ImageTitle" value="{FORMITEM.ImageTitle}" class="full-width">
					                </p>
					                <p>
					                    <label for="simple-required">Thuôc tính alt của thẻ img</label>
					                    <input type="text" name="ImageAlt" id="ImageAlt" value="{FORMITEM.ImageAlt}" class="full-width">
					                </p>
					                <p>
					                    <label for="simple-required">Đường dẫn website</label>
					                    <input type="text" name="Link" id="Link" value="{FORMITEM.Link}" class="full-width">
					                </p>
					                <p>
					                    <label for="Description">Miêu tả: </label>
					                    <textarea name="Description" id="Description" class="full-width height-100">{FORMITEM.Description}</textarea>
					                </p>
                                </div>
                            </div>
			                
			            </fieldset>
			            <fieldset class="grey-bg no-margin">
			                <p class="input-with-button" align="center">
			                    <button type="submit">
			                        hoàn thành
			                    </button>
			                    <a href="maincontent.php?ctrl={CONTROLLER}&act=view-grid&type={FORMITEM.Type}"> 
				                    <button type="button">
		                                hủy bỏ
		                            </button> 
	                            </a>
			                </p>
			            </fieldset>
			            <!-- BEGIN: FORMITEM -->
			        </form>
			</section>
        </div>
<!-- END: PAGECONTENT -->